<script type="text/javascript">
var paginationTotal = 1;//记录总数
$(document).ready(function() {
 	loadData(0);
	$('#billDateFrom,#billDateTo').datepicker({
			changeMonth: true,
			changeYear: true,			 
			dateFormat: 'yy-mm-dd'
	});
	
});

function inquire(){
 loadData(0);
	 
}
 
function loadData(page,pageSize,sortObj){
	 
	$.ajax({ //这里使用到Jquery的ajax方法
	  type: "POST",
	  async: false,
	  dataType: "json",
	  url: "/merchant/stocktake/list", //请求的处理url
	  data:{'page':page,'pageSize':pageSize}, 	  
	  success: function(json) { 	   
		if(json.ask){
			var html= '';
			$.each(json.result,function(key,val){			
				if((key+1)%2 ==1) {
					html += '<div class="line1">';
				}else{
					html += '<div class="line2">';
				}
				html += '<div class="billCol1 cell">'+val.ts_code+'</div>';
				html += '<div class="billCol2 cell">'+val.ts_status+'</div>';
				html += '<div class="billCol3 cell">'+val.ts_creat_time+'</div>';
				html += '<div class="billCol4 cell">'+val.ts_update_time+'</div>';		
				html += '<div class="billCol7 cell">';
					html += '<img src="/images/icon_view.gif" title="Detail" onclick="showDetail(\''+val.ts_code+'\')" style="cursor:pointer;" />';
				html += '</div>';
				html += '</div>'; 			
			});
		 
		 }else{
			html ='<div  class="billCol0">No Result</div>'			 
		 }
		 $('#stocktake').html(html);
	  }
	}); 
}

function showDetail(code){
	openIframeDialog('/merchant/stocktake/detail/code/' + code, 650, 450); 
}
	
</script>
 
<style type="text/css">
 
.billCol1 {
    float: left;
    line-height: 25px;     
    width: 20%;
}
.billCol2 {
    float: left;
    line-height: 25px;     
    width: 15%;
}
.billCol3 {
    float: left;
    line-height: 25px;
    width: 25%;
}
.billCol4 {
    float: left;
    line-height: 25px;
    width: 25%;
}

.billCol7 {
    float: left;
    line-height: 25px;
    width: 15%;
	border-right:0 none;
	background: url("") repeat-y right top;
    background-image: url("");
    background-repeat-x: no-repeat;
    background-repeat-y: repeat;
    background-attachment: initial;
    background-position-x: 100%;
    background-position-y: 0%;
    background-origin: initial;
    background-clip: initial;
    background-color: initial;
}

.billCol0 {
    float: left;
    line-height: 25px;
    width: 100%;
}
.line1 {
	height: 25px;
	width: 100%;
	background: none repeat scroll 0 0 #FFFFFF;
	text-align:center;
}
.line1:hover {
	background-color:#F2F8F9;
}
.line2:hover {
	background-color:#F2F8F9;
}
.line2 {
	height: 25px;
	width: 100%;
	text-align:center;
}
.sort{cursor:pointer;}
.sort:hover{color:black;}

</style>
<div class="position"><a href='/default/index'>Home</a> &gt; <a href='/merchant/my-account'>Merchant Center</a>  &gt; Others &gt; stocktake List </div>

<div class="merchant-content" style="border-bottom: 1px solid #CCCCCC;">
	<div style="margin:5px;border-bottom: 1px solid #CCCCCC;"><div>
</div>	


<div id="billing-form" style="margin-top:10px;">
<form id="billing-detail" name="billing-detail" method="post" action="">

</form>
</div>

<div style="margin-top:5px;">

	<div class="tab-div row">
		<div class="row height25 row-header">  
			<div class="billCol1 cell">stocktake code</div>
			<div class="billCol2 cell">status</div>
			<div class="billCol3 cell">creat time</div>
			<div class="billCol4 cell">update time</div>	
			<div class="billCol7 cell">Operation</div>
		 
		</div>                                
		<div id="stocktake"> </div>
</div>	


</div>